/*
 * @Author: Suo-Yuheng syh15399227325@163.com
 * @Date: 2025-09-08 18:06:22
 * @LastEditors: Suo-Yuheng syh15399227325@163.com
 * @LastEditTime: 2025-09-09 11:34:52
 * @FilePath: /0907/tcp/Main.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */ 
#include "TcpServer.hpp"
#include <memory>
#include <string>


using namespace std;

void Usage(string proc)
{
    cout << "\n\tUsage: " << proc << " port[1024+]\n" << endl;
}


// ./tcpserver port
int main(int argc, char *argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(UsageError);
    }

    uint16_t port = stoi(argv[1]);

    lg.Enable(Classfile);

    unique_ptr<TcpServer> tcp_svr(new TcpServer(port, "8.137.112.44"));
    tcp_svr->InitServer();

    

    tcp_svr->Start();



    return 0;
}